import matplotlib.pyplot as plt
from pywaffle import Waffle
data={'上座':150,'空座':50}
total = sum(list(data.values()))
plt.figure(
        FigureClass=Waffle, rows=10, columns=10,
        values=data, vertical = True,
        title = {'label':'某电影上座率华夫饼图'},
        legend = {
                'labels': [
        '({}){:.0f}%'.format(k,100*v/total) for k, v in data.items ()
                ],
        'bbox_to_anchor':(0.85,-0.1),
        'ncol': 2,
        'frameon': False
        }
)
plt.show()